-module(mochiweb_hello2).
-export([h/1]).

-include_lib("ewgi/include/ewgi.hrl").

h(Ctx) ->
    Qs = ewgi_api:query_string(Ctx),
    ParsedQs = ewgi_api:parse_qs(Qs),
    Name = ewgi_api:get_value("name", ParsedQs, "World"),
    Resp = ["<html>
<head><title>Hello!</title></head>
<body>
<h1>Hello ", Name, "!</h1>
</body>"],
    Resp,
    ewgi_api:set_response(#ewgi_response{status=?OK, headers=[], message_body=Resp}, Ctx).
